// This MFC Samples source code demonstrates using MFC Microsoft Office Fluent User Interface 
// (the "Fluent UI") and is provided only as referential material to supplement the 
// Microsoft Foundation Classes Reference and related electronic documentation 
// included with the MFC C++ library software.  
// License terms to copy, use or distribute the Fluent UI are available separately.  
// To learn more about our Fluent UI licensing program, please visit 
// http://msdn.microsoft.com/officeui.
//
// Copyright (C) Microsoft Corporation
// All rights reserved.

// wfdeqDoc.h : interface of the CwfdeqDoc class
//
/**
 * @defgroup Interface MFC User Interface
 */

/**
 * \file
 * \ingroup Interface
 * ---
 *	Interface of the CwfdeqDoc class, implementation at wfdeqDoc.cpp
 *
*/

#pragma once
#include "PDE.h"
#include "ViewList.h"
#include "afxtempl.h"
#include "fdSolution.h"
#include "cfdgrid.h"

/**
 * \ingroup Interface
 * \brief Only Document class of MFC document/View architecture.
 * \author HapTork
*/

class CwfdeqDoc : public CDocument
{
protected: // create from serialization only
	CwfdeqDoc();
	DECLARE_DYNCREATE(CwfdeqDoc)

// Attributes
public:

// Operations
public:

// Overrides
public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
#ifdef SHARED_HANDLERS
	virtual void InitializeSearchContent();
	virtual void OnDrawThumbnail(CDC& dc, LPRECT lprcBounds);
#endif // SHARED_HANDLERS

// Implementation
public:
	virtual ~CwfdeqDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	DECLARE_MESSAGE_MAP()

#ifdef SHARED_HANDLERS
	// Helper function that sets search content for a Search Handler
	void SetSearchContent(const CString& value);
#endif // SHARED_HANDLERS
	CString m_sDomainX;
	CString m_sDomainY;
	CString m_sDomainT;
	CString m_sInitialU;
	CString m_sInitialV;
	CString m_sAuxiliary;
	CString m_sLeftBU;
	CString m_sTopBU;
public:

protected:
	CString m_sBottomBU;
	CString m_sRightBU;
public:
		/** Method: Bandsolve
	 * ---
	 * TODO: 
	 * Solves a Band-grid
	 * @param	bandwidth	bandwidth of the grid
	 */
	void UpdateUI(void);
	afx_msg void OnDomainx();
	afx_msg void OnDomainy();
	afx_msg void OnLeftBoundary();
protected:
	CMFCRibbonBar* pRibbon;
public:
	afx_msg void OnRightBoundary();
	afx_msg void OnTopBoundary();
	afx_msg void OnBottomBoundary();
	afx_msg void OnInitial();
	afx_msg void OnAuxiliary();
	afx_msg void OnDomaint();
	afx_msg void OnSetPde();
protected:
	PDE *pdeq;
	CString m_sNx;
	CString m_sNy;
	int m_nSelectScheme;
public:
	afx_msg void OnNx();
	afx_msg void OnNy();
	afx_msg void OnSelectScheme();
protected:
public:
	afx_msg void OnExact();
protected:
	CString m_sExactU;
public:
	int UpdateFD(void);
	PDE* getPde(void);
	CArray<fdSolution,fdSolution&> soList;
	cfdGrid* eGrid;
	int m_nLcmX;
	int m_nLcmY;
protected:
	bool updateLcm(int nx, int ny);
public:
	afx_msg void OnEditName();
protected:
	CString m_sName;
public:
	/** (0)1-variable unsteady, (1)1-variable steady, (2)2-variable unsteady; (3)2-variable steady;*/
	int m_nPdeType;
	bool isUxChkd;
protected:
	CString m_sLeftBV;
	CString m_sRightBV;
	CString m_sTopBV;
	CString m_sBottomBV;
public:
	CString m_sExactV;
	afx_msg void OnUpdateButtonU(CCmdUI *pCmdUI);
	afx_msg void OnButtonU();
	afx_msg void OnButtonV();
	afx_msg void OnUpdateButtonV(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDomaint(CCmdUI *pCmdUI);
protected:
	// Updates first Category of RiboonBar
	void UpdateEqUI(void);
public:
	CwfdeqApp* pApp;
	afx_msg void OnNt();
	CString m_sNt;
	cfdGrid eGrid2;
	afx_msg void OnSolutionList();
	afx_msg void OnInfo();
	afx_msg void OnDllName();
	afx_msg void OnLoadScheme();
	afx_msg void OnGraphIt();
};